colorAdminApp.controller('userInfoUpdateController', function($scope,$rootScope,$http,$state,$stateParams,modalService) {
	
		$scope.loadEntity=function(){
			var entity={};
			$http.post('core/user/getCurrentUser.htm',{params:entity}).success(function(data, status, headers, config) {
			    $scope.user=data;
			}).error(function(data, status, headers, config) {
		    	alert(data);
	        });  
		};
		
       $scope.save=function(){
			var entity={};
			
			entity["realName"]=$scope.user.realName;
			entity["gender"]=$scope.user.gender;
			entity["email"]=$scope.user.email;
			entity["mobilePhone"]=$scope.user.mobilePhone;
			entity["address"]=$scope.user.address;
			entity["company"]=$scope.user.company;
			
			$http.post('core/user/updateInfo.htm',{params:entity}).success(function(data, status, headers, config) {
			    modalService.showAlertModal('注意',data.message);
			}).error(function(data,status, headers, config) {
		    	alert(data);
	        });  
		};
		
		$scope.loadEntity();
		
});
